
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">{$title}</h4>
            </div>
            <input type="hidden" id="pro_id" value="{$pro_id}">
            <div class="modal-body">

                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                            <p></p>
                        </div>
                    </div>
                </div>

                <div class="row clearfix">
                    <div class="col-md-12">
                        <table class="table table-striped ntTable">
                            <tbody>
                                <tr>
                                    <td>{:lang("product_information")}</td>
                                    <td>
                                    	<!-- <small>8888 / {:lang("brand")}</small><br />
                                        红外线USB鼠标 -->
                                        {if isset($productList)}
                                        {foreach $productList as $k=>$v}
                                            <small>{$v.id} / {$v.brand_name}</small><br />
                                                {$v.pro_name}
                                            {/foreach}
                                            <input type="hidden" id="pro_id" value="{$v.id}">
                                        {else /}
                                            <input type="hidden" id="pro_id" value="0">
                                        {/if}
                                    </td>
                                </tr>
                                <tr>
                                    <td>图片上传</td>
                                    <td>
                                        <div class="input-group">
                                            <input type="text" class="form-control">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-primary up-img">
                                                    <span class="fa fa-upload"> </span> {:lang("upload_image")}
                                                </button>
                                                <input type="file" id="inName" name="files[]" multiple  style="opacity: 0">
                                            </span>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                	<td colspan="2">
                                    	<div class="row preview" style="margin: 0;">
	                                        
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:lang('cancel')}</button>
                <button type="button" class="btn btn-primary savefun" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-ok"></span>{:lang('confirm')}</button>
            </div>
            <script>
                    var read = new FileReader()
                    $('.up-img').click(function(){
                        $('#inName').click()
                    })
                    var filearr=[]
                    $('#inName').change(function(){
                        var imgurl=$(this).val().replace(this.files[0].name,"")
                    for(var i=0;i<this.files.length;i++){
                        var is_same=true
                        for(var n=0;n<filearr.length;n++){
                            if(this.files[i].name==filearr[n].name){
                                is_same=false
                            }
                        }
                        // console.log(is_same)
                        if(is_same){
                            this.files[i].path=imgurl
                            filearr.push(this.files[i])
                        }
                    }
                        
                    var strhtml=""
                        for(var i=0;i<filearr.length;i++){
                            // console.log(filearr[i])
                            strhtml+='<div class="col-lg-2 col-md-3 col-ms-4 col-xs-6"><span class="delhov">{:lang('delete')}</span><img data-name="'+filearr[i].name+'" src="'+URL.createObjectURL(filearr[i])+'" border="0" class="imgbox" width="128px" eight="128px" style="padding:1em"></div>'
                        }
                        $('.preview').html(strhtml)
                        $('.preview').find('.delhov').click(delfun)
                        $('#inName').val('')
                    })
                    function delfun(){
                            for(var n=0;n<filearr.length;n++){
                                if(filearr[n].name==$(this).parent().find('img').attr('data-name')){
                                    filearr.splice(n,1)
                                }
                            }
                            strhtml=""
                            for(var i=0;i<filearr.length;i++){
                                strhtml+='<div class="col-lg-2 col-md-3 col-ms-4 col-xs-6"><span class="delhov">{:lang('delete')}</span><img data-name="'+filearr[i].name+'" src="'+URL.createObjectURL(filearr[i])+'" border="0" class="imgbox" width="128px" eight="128px" style="padding:1em"></div>'
                            }
                            $('.preview').html(strhtml)
                            $('.preview').find('.delhov').click(delfun)
                        }
                        $('.savefun').click(function(){
                            /* console.log(filearr) */
                            var formData = new FormData();
                            formData.append('pro_id',$('#pro_id').val());
                            for (var i = 0; i < filearr.length; i++) {
                                formData.append("file["+i+"]", filearr[i]);
                            }
                            $.ajax({
                                url:'/admin/product/imgUpdate',
                                type:'POST',
                                data:formData,
                                cache: false,
                                contentType: false,    //不可缺
                                processData: false,    //不可缺
                                success:function(data){
                                    data = JSON.parse(data)
                                    if(data.status==1){
                                    change_mes_type('.alert',data.status)
                                    $('.alert').show()
                                    $('.alert p').html('*'+data.msg+'<br>')
                                        //toastr.info(data.msg)
                                    $('#proimgs_uploadModal').modal('hide')
                                        /* setTimeout(function(){
                                            location.reload();
                                        },1000) */
                                    }else{
                                    change_mes_type('.modal-body .alert',data.status)
                                    $('.modal-body .alert').show()
                                    $('.modal-body .alert p').html('*'+data.msg+'<br>')
                                        // toastr.warning(data.msg);
                                    }
                                }
                            });
                        })
                </script>